// 存储token的键名
const TOKEN_KEY = 'admin_token'

// 获取token
export const getToken = (data) => {
  return localStorage.getItem(data)
}

// 设置token
export const setToken = (token) => {
  localStorage.setItem(TOKEN_KEY, token)
}

// 移除token
export const removeToken = (data) => {
  localStorage.removeItem(data)
}

// 判断是否有token
export const hasToken = () => {
  return !!getToken()
}